<template>
  <div>
    <el-form :inline="true" :model="formInline" class="demo-form-inline">
      <el-form-item label="名字">
        <el-input v-model="formInline.name" placeholder="名字"></el-input>
      </el-form-item>
      <el-form-item label="原因">
        <el-input v-model="formInline.reason" placeholder="原因"></el-input>
      </el-form-item>
      <el-form-item label="天数">
        <el-input v-model="formInline.days" placeholder="天数"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="add">添加</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: "AddView",
  data() {
    return {
      formInline:{},
    }
  }, methods: {
    add(){
      this.axios.post("tadd",this.formInline).then(res=>{
        console.log(res)
        this.$router.push("/tlist");
      })
    },
  }, created() {

  }
}
</script>

<style scoped>

</style>